<div class="col-sm-12">
  <div class="box clearfix">
    <div class="bottom12 padding-left-15">
        <ul class="nopadding-left border-bottom">
            <li class="pull-left margin-right30 {{unless  inTabFlag " jujia-select-bottom-border"}}" {{action "changeTab" false on="click"}} >
                <a href="#tab_1_1" data-toggle="tab" class="{{if inTabFlag 'noselect-title'  'jujia-select-title' }} the-a">奖励项目</a>
            </li>
            <li class="pull-left margin-right30  {{if inTabFlag " jujia-select-bottom-border"}}" {{action "changeTab" true on="click"}}>
                <a href="#tab_1_2" data-toggle="tab" class="{{if inTabFlag 'jujia-select-title'  'noselect-title' }} the-a">罚款项目</a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
    <!-- BOX -->
    <div id="" class="dataTables_wrapper form-inline col-sm-4" style="padding-left:20px;" role="grid">
      <div class="col-sm-12 nopadding-left nopadding-right" style="font-size:14px;margin-bottom:5px;font-weight: bold;color:#8d8d8d;line-height:30px;">
        项目规定
        <div class="col-sm-4 pull-right user-add-btn nopadding-right" >
          {{#ui/mix-button class="user-btn pull-right" iconClass="fa-plus"  text='新增项目'  clickAction="toAddParent"  toAddParent="toAddParent" clickActParams='parent'}}
          {{/ui/mix-button}}
        </div>
      </div>
      {{#if assessmentList}}
        {{#each assessmentList as |assessment|}}
          <div class="customer-drug-list-notop col-sm-12 nopadding-left pointer nopadding-right {{if assessment.hasChoosed 'drugcolor' ''}}"
          style="font-size:13px;" {{action 'chooseParent' assessment on="click"}}
          {{action 'hoverAssessment' assessment on="mouseEnter" bubbles=false}}
          {{action 'leaveAssessment' assessment on="mouseLeave" bubbles=false}}
          >
            {{#if assessment.edit}}
              {{input class="form-control " value=assessment.name type="text" autofocus=true placeholder="必填" focusOut=(action "saveAssessment" assessment) bubbles=false}}
            {{else}}
              <span class="col-sm-10" >{{assessment.name}}</span>
            {{/if}}
            {{#if assessment.hover}}
              {{#unless assessment.edit}}
              <span class="col-sm-2 pull-right nopadding-left nopadding-right">
                <i class="fa fa-edit" {{action 'detailEditClick' assessment on="click" bubbles=false}}>{{bs-tooltip title="编辑" class="light-tooltip"}}</i>
                <i class="fa fa-trash-o" {{action 'delById' assessment 'parent' on="click" bubbles=false}}>{{bs-tooltip title="删除" class="light-tooltip"}}</i>
              </span>
              {{/unless}}
            {{/if}}
          </div>
        {{/each}}
      {{else}}
        <div class="col-sm-12 center nopadding-left" style="font-size:16px;">{{if leftLoading "加载中.." "暂无数据"}}</div>
      {{/if}}
    </div>
    {{#if curParent}}
    <div id="datatable2_wrapper" class="dataTables_wrapper form-inline col-sm-8"  role="grid" >
        <div class="col-sm-2 pull-left  nopadding-left nopadding-right" style="font-size: 14px;font-weight: bold;color:#8d8d8d;line-height:30px;">
          规定细则
        </div>
        <div class="col-sm-2 pull-right  nopadding-left nopadding-right user-add-btn">
          {{#ui/mix-button class="user-btn pull-left" iconClass="fa-plus"  text='新增细则'  clickAction="toAddParent" toAddParent="toAddParent" clickActParams='child'}}
          {{/ui/mix-button}}
        </div>
        {{#if childrenList}}
          <table id="datatable1" cellpadding="0" cellspacing="0" border="0"  class="datatable table table-bordered table-hover dataTable" aria-describedby="datatable1_info" style="margin-top: 46px;">
            <thead>
              <tr role="row">
                <th rowspan="1" colspan="1" width="">细则内容</th>
                <th rowspan="1" colspan="1" width="132">{{if inTabFlag "罚款" "奖励"}}金额（元）</th>
                <th rowspan="1" colspan="1" width="90">操作</th>
              </tr>
            </thead>
            <tbody role="alert" aria-live="polite" aria-relevant="all" class="">
              {{#each childrenList as |child|}}
                <tr class="">
                  <td class="ellipsis">{{child.remark}}</td>
                  <td class="ellipsis">{{child.money}}</td>
                  <td class="ellipsis">
                    <a {{action "editChild" child 'child' on="click" bubbles=false}}>编辑</a>
                    <a {{action "delById" child 'child' on="click" bubbles=false}}>删除</a>
                  </td>
                </tr>
              {{/each}}
            </tbody>
          </table>
        {{else}}
          <div class="center col-sm-12" style="font-size:16px;">{{if rightLoading "加载中.." "请添加项目细则"}}</div>
        {{/if}}
    </div>



        {{/if}}
    <!-- /BOX -->
    </div>
</div>

{{#if parentModel}}
  {{#bs-modal body=false footer=false header=false closeAction='invitation'}}
    {{#bs-modal-header}}
      <h3 class="modal-title">{{modelName}}</h3>
    {{/bs-modal-header}}
    {{#bs-modal-body}}
    {{#bs-form formLayout=formLayout model=assessmentModel }}
      <div>
        <div class="col-xs-12 nopadding-left nopadding-right">
          <div class="form-input-group col-sm-12">
            <span class="input-group-addon">规定项目：</span>
            {{#bs-form-element controlType="name"  property="name" }}
              {{input class="form-control " value=assessmentModel.name type="text" placeholder="必填"}}
            {{/bs-form-element}}
          </div>
        </div>
      </div>
    {{/bs-form}}
    {{/bs-modal-body}}
    {{#bs-modal-footer class="user-add-btn"}}
      {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-save"  text='确定' clickAction="saveNewAssessment" saveNewAssessment="saveNewAssessment"}}
      {{/ui/mix-button}}
      {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-undo"  text='取消'  clickAction="invitation" invitation="invitation"}}
      {{/ui/mix-button}}
		{{/bs-modal-footer}}
  {{/bs-modal}}
{{/if}}

{{#if childModel}}
  {{#bs-modal body=false footer=false header=false closeAction='invitation'}}
    {{#bs-modal-header}}
      <h3 class="modal-title">{{itemModelName}}</h3>
    {{/bs-modal-header}}
    {{#bs-modal-body}}
    {{#bs-form formLayout=formLayout model=assessmentItemModel }}
      <div>
        <div class="col-xs-12 nopadding-left">
          <div class="form-input-group">
            <span class="input-group-addon">细则名称：</span>
            {{#bs-form-element controlType="remark"  property="remark" }}
              {{input class="form-control " value=assessmentItemModel.remark type="text" placeholder="必填"}}
            {{/bs-form-element}}
          </div>
        </div>
        <div class="col-xs-6 nopadding-left">
          <div class="form-input-group">
            <span class="input-group-addon">{{if inTabFlag "罚款" "奖励"}}金额（元）：</span>
            {{#bs-form-element  controlType="money"  property="money" }}
              {{input class="form-control " value=assessmentItemModel.money type="text" placeholder="必填"}}
            {{/bs-form-element}}
          </div>
        </div>
      </div>
    {{/bs-form}}
    {{/bs-modal-body}}
    {{#bs-modal-footer class="user-add-btn"}}
      {{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-save"  text='确定' clickAction="saveNewAssessment" saveNewAssessment="saveNewAssessment" clickActParams="child"}}
      {{/ui/mix-button}}
      {{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-undo"  text='取消'  clickAction="invitation" invitation="invitation"}}
      {{/ui/mix-button}}
		{{/bs-modal-footer}}
  {{/bs-modal}}
{{/if}}
